import request from '@/utils/request'

const jobApi = {
  list: '/job/list',
  creat: '/job/add',
  edit: '/job/change',
  Delete: '/job/delete',
  isStart: '/job/isstart',
}

/**
 * jobList func
 * parameter: {
 *     username: '',
 *     password: '',
 *     captcha: '12345'
 * }
 * @param parameter
 * @returns {*}
 */
// 获取job列表
export function jobList (parameter) {
  return request({
    url: jobApi.list,
    method: 'get',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8'
		},
    params: parameter,
  })
}
// 创建job
export function jobCreat (parameter) {
  return request({
    url: jobApi.creat,
    method: 'post',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8'
		},
    params: parameter,
  })
}
// 开启/关闭job
export function jobIsStart (parameter) {
  return request({
    url: jobApi.isStart,
    method: 'post',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8'
		},
    params: parameter,
  })
}
// 编辑job
export function jobEdit (parameter) {
  return request({
    url: jobApi.edit,
    method: 'post',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8'
		},
    params: parameter,
  })
}
// 删除job
export function jobDelete (parameter) {
  return request({
    url: jobApi.Delete,
    method: 'post',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8'
		},
    params: parameter,
  })
}

